package com.sunyard.dal.mapper;

import com.sunyard.dal.bo.TaskCopyQueryBO;
import com.sunyard.dal.dto.DeviceTaskCopyDTO;
import com.sunyard.dal.dto.TaskCopyDTO;
import com.sunyard.dal.dto.TaskDetailDTO;
import com.sunyard.dal.entity.TaskCopy;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface TaskCopyMapper {

    int deleteByPrimaryKey(String auditId);

    int insert(TaskCopy record);

    int insertSelective(TaskCopy record);

    TaskCopy selectByPrimaryKey(String auditId);

    int updateByPrimaryKeySelective(TaskCopy record);

    int updateByPrimaryKey(TaskCopy record);

    List<TaskCopyDTO> findAllTaskByPage(TaskCopyQueryBO taskCopyQueryBO);

    /**
     * @Description: 根据机构ID获取审核任务list
     * @Author: jiy.fang
     * @Date: 2019/7/24 15:25
     */
    List<TaskCopy> getListTaskByOrgId(String orgId);

    /**
     * @Description: 统计数量
     * @Author: huix.Liang
     * @Date: 2019-07-26 10:01
     */
    Integer countAuditingByTaskId(@Param("taskId") String taskId, @Param("deviceSn") String deviceSn);

    /**
     * @Description: 分页查询终端任务
     * @Author: huix.Liang
     * @Date: 2019-07-26 10:13
     */
    List<DeviceTaskCopyDTO> getListDeviceTaskCopy(TaskCopy taskCopy);

    /**
     * @Description: 任务审核详情
     * @Author: huix.Liang
     * @Date: 2019-08-01 11:28
     */
    DeviceTaskCopyDTO getTaskCopyDetail(@Param("auditId") String auditId);

    TaskDetailDTO showRecordChange(String auditId);

    /**
     * @Description: 验证任务添加是否同一终端对同一应用是否存在未审核的记录
     * @Author: ziliang.zhou
     * @Date: 2019-08-01 11:28
     */
    int checkDeviceTask(TaskCopy taskCopy);

    /**
     * @Description: 验证任务添加是应用是否存在未审核的记录
     * @Author: ziliang.zhou
     * @Date: 2019-08-01 11:28
     */
    int checkTaskStatusByAppId(String appId);
}